package com.ruoyi.api.client.api;

import com.ruoyi.api.client.domain.dto.UmsUserDto;
import com.ruoyi.api.client.domain.vo.UmsUserVo;
import com.ruoyi.api.client.service.IClientUmsService;
import com.ruoyi.common.annotation.SaClientCheckLogin;
import com.ruoyi.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zouhuu
 * @description 客户端用户模块API
 * @date 2022/08/01 21:57:52
 */
@Api(tags = "客户端-用户模块API")
@SaClientCheckLogin
@RestController
@RequestMapping("/api/client/ums")
public class UmsApi {

    @Autowired
    private IClientUmsService clientUmsService;

    @ApiOperation("用户信息")
    @GetMapping("/user/info")
    public R<UmsUserVo> userInfo () {
        return clientUmsService.userInfo();
    }

    @ApiOperation("用户信息保存")
    @PostMapping("/user/save")
    public R userSave (@RequestBody UmsUserDto umsUserDto) {
        return clientUmsService.userSave(umsUserDto);
    }

}
